package com.vf.admin.client.controller.uniapp;

import com.vf.admin.client.common.ClientBaseController;
import com.vf.admin.client.service.AppUniappService;
import com.vf.admin.common.entity.Result;
import com.vf.admin.miaodong.entity.AppUniapp;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

/**
 * <p>Title : </p>
 * <p>Description : </p>
 * <p>DevelopTools : IDEA</p>
 * <p>DevelopSystem : Windows11</p>
 *
 * @Author : zxw
 * @Date 2023/10/10 11:45
 */
@RestController
@RequestMapping("/api")
public class UniAppController  extends ClientBaseController {


    @Resource
    private AppUniappService appUniappService;


    @GetMapping("/getVersion")
    @ResponseBody
    public Result getVersion(){
        AppUniapp appUniapp = appUniappService.list().get(0);
        Map<String,Object> map = new HashMap<>();

        map.put("vs",appUniapp.getVs());
        map.put("vss",appUniapp.getVss());
        map.put("open",appUniapp.getOpen()); //1开启 0关闭
        map.put("wgtUrl",appUniapp.getWgtUrl());

        return this.sucessJSON(map);


    }
}
